﻿Imports System
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Workflow.ComponentModel
Imports System.Workflow.ComponentModel.Design

Namespace System.Workflow.Activities
    <ActivityDesignerTheme(GetType(ConditionedActivityGroupDesignerTheme))> _
    Friend NotInheritable Class ConditionedActivityGroupDesigner
        Inherits ActivityPreviewDesigner
        ' Methods
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            MyBase.Dispose(disposing)
        End Sub

        Protected Overrides Sub Initialize(ByVal activity As Activity)
            MyBase.Initialize(activity)
            Dim service As IExtenderListService = DirectCast(MyBase.GetService(GetType(IExtenderListService)), IExtenderListService)
            If (Not service Is Nothing) Then
                Dim flag As Boolean = False
                Dim provider As IExtenderProvider
                For Each provider In service.GetExtenderProviders
                    If (provider.GetType Is GetType(ConditionPropertyProviderExtender)) Then
                        flag = True
                    End If
                Next
                If Not flag Then
                    Dim service2 As IExtenderProviderService = DirectCast(MyBase.GetService(GetType(IExtenderProviderService)), IExtenderProviderService)
                    If (Not service2 Is Nothing) Then
                        service2.AddExtenderProvider(New ConditionPropertyProviderExtender)
                    End If
                End If
            End If
        End Sub

    End Class
End Namespace

